## [1] "Output created on 2018-09-10"
## [1] "Dataset used: /kriegsteinlab/data1/aparna/homefiles/gw14.RData"
## [1] "Metadata file used: /kriegsteinlab/data1/carmen/2nd-trimester/metadata/colnames_GW14_080818_fixed.txt"
## [1] "Sample Age (from user input): GW14"

Prepare session before running this .Rmd script.

To run this R Markdown file, enter the following chunks of code in an R session, with the appropriate paths and file names.

2. Run the script

Call the knitr::render function indicating the path to this .Rmd file:

User input:

    1. Indicate the age of the sample.
    1. Path to the dataset (in this case, an .RData workspace file), and the name of the Seurat object contained within the loaded workspace.
    1. Path to a metadata file with cell names and their brain regions of origin.
    1. Choose an upper limit for nGenes and nUMIs for more useful zoomed-in plots.
    1. Choose a size for the x-axis labels text (the optimal size depends on the number of brain regions in the sample).

R Markdown script begins here:

3. Set cells’ brain region of origin as their original identity

In both the @ident and the @meta.data slots of the Seurat object.

5. Calculate mean UMIs, genes, ribosomal and mitochondrial % for each brain region.

Some useful metadata stats:

##      nGene           nUMI       percent.mitochondrial percent.ribosomal
##  Min.   :  41   Min.   :  191   Min.   :0.000         Min.   :0.0081   
##  1st Qu.: 369   1st Qu.:  580   1st Qu.:0.013         1st Qu.:0.1903   
##  Median : 507   Median :  855   Median :0.018         Median :0.2319   
##  Mean   : 580   Mean   : 1056   Mean   :0.019         Mean   :0.2364   
##  3rd Qu.: 684   3rd Qu.: 1253   3rd Qu.:0.024         3rd Qu.:0.2772   
##  Max.   :8426   Max.   :60900   Max.   :0.146         Max.   :0.7857

PLOTS


Declare general functions: violin.discrete and violinplot.colorby.

Violin plot function: Continuous; cells colored by selected variable.

Scatterplots: QC metrics by brain region.

Scatterplot: Declare general ggplot.fun and print.plot functions.